<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>EXP-1</title>
    <style>
        video {width: 400px; height: 300px;}
    </style>
</head>
<body>
    <video id="video1"></video>
    <video id="video2"></video>
	<img src="./1.png">
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page"><img src="./1.png"></div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page"><img src="./1.png"></div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page"><img src="./1.png"></div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <div class="pdf-page">sdfsdsdfsf</div>
    <script src="./html2canvas.min.js"></script>
    <script src="./jspdf.umd.min.js"></script>
    <script src="./jszip.min.js"></script>
    <script src="./jstools.web.js"></script>
    <script>
        console.info('全局变量$jstools:')
        console.log($jstools)
        // let x = document.body.clientWidth / 2
        // let y = document.body.clientHeight / 2
        let url = $jstools.TXT2SVG({content: '全局变量jstools', rotate: -45, fontFamily:'system-ui, sans-serif'}).encode
        document.body.style.background = `url("${url}")`
        // document.body.style.background = `#000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='50%25' y='50%25' font-size='14' fill='%23ffffff' font-family='system-ui, sans-serif' text-anchor='middle' dominant-baseline='middle'%3E视频无法预览%3C/text%3E%3C/svg%3E") no-repeat center`
        let template = [
            // 'https://ahuyikao.cdn.bcebos.com/zhongyi/2019/中医技能-{{name1}}.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/zhongyi/2019/中医技能-{{name2}}{{order}}-{{name1}}.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/真题/中医/{{date}}中医真题直播.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/zhongyi/2019/{{date}}中医.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/2020直播课/中医/基础精讲班/{{date}}中医.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/2020直播课/中医/基础精讲班/{{date}}中医、中西医-{{name1}}.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/2020直播课/中医/基础精讲班/{{date}}中医、中西医.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/zhongyiyishu/2019/确有专长{{order}}.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/zhongyiyishu/2019/确有专长-{{name1}}.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/zhongyiyishu/2019/师承-{{name1}}_(new).mp4',
            // 'https://ahuyikao.cdn.bcebos.com/zhongyiyishu/2019/{{date}}中医考前押题.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/zhongyi/2019/金考点-中医-{{name1}}_(new).mp4',
            // 'https://ahuyikao.cdn.bcebos.com/zhongyi/2019/金考点-中医-{{name1}}-1_(new).mp4',
            // 'https://ahuyikao.cdn.bcebos.com/zhongyi/2019/金考点-中医-{{name1}}——中医_(new).mp4',
            // 'https://ahuyikao.cdn.bcebos.com/zhongyi/2019/金考点-中医-{{name1}}——中医-1_(new).mp4',
            // 'https://ahuyikao.cdn.bcebos.com/xiangcun/2019/{{name1}}.mp4',
            // 'https://ahuyikao.cdn.bcebos.com/xiangcun/2019/金考点-乡村-{{name1}}_(new).mp4',
            // 'https://ahuyikao.cdn.bcebos.com/中级职称/中西医结合内科学/基础知识/中药学（李烁）/{{name1}}_(new).mp4',
            // 'https://ahuyikao.cdn.bcebos.com/中级职称/中西医结合内科学/基础知识/中药学（李烁）/{{name1}}_(new).mp',
            // 'https://mp4-from.cdn.bcebos.com/2021zhibo/zhongyi/{{date}}中医、中西医备考导学课.mp4',
            // 'https://mp4-from.cdn.bcebos.com/2021zhibo/zhongyi/{{date}}中医、中西医.mp4'
        ]
        let name1 = [
            // 课时名称
        ]
        let name2 = [
            // 章节名称
        ]
        let order = [
            // 序号
        ]
        let date = [
            // 日期
            '10.21',
            '10.23',
            '12.23',
        ]
        let urls = $jstools.enumStringByTemplate({
            template: template,
            date: date
        })
        let count = 0
        // urls.forEach(url => {
        //     setTimeout(() => {
        //         $jstools.checkUrlStatus(url).then((res)=>{console.log(res)})
        //     }, count * 1000)
        //     count++
        // })
    </script>
    <script>
        class myPromise {
            constructor (fn) {
                const _this = this
                this.__queue = []
                this.__succ_res = null
                this.__erro_res = null
                this.status = ''
                fn(function (...arg) {
                _this.__succ_res = arg
                _this.status = 'resolved'
                _this.__queue.forEach(json => {
                    json.fn1(...arg)
                })
                }, function (...arg) {
                _this.__erro_res = arg
                _this.status = 'rejected'
                _this.__queue.forEach(json => {
                    json.fn2(...arg)
                })
                })
            }
            then (fn1, fn2) {
                if (this.status === 'resolved') {
                fn1(...this.__succ_res)
                } else if (this.status === 'rejected') {
                fn2(...this.__erro_res)
                } else {
                this.__queue.push({fn1, fn2})
                }
            }
        }
        myPromise.all = function (arr) {
            return new myPromise(function (resolve, reject) {
                let i = 0
                let result = []
                next()
                function next () {
                    arr[i].then(function (res) {
                        result.push(res)
                        i++
                        if (i === arr.length) {
                        resolve(result)
                        } else {
                        next()
                        }
                    }, reject)
                }
            })
        }
        // window.aa = myPromise.all([
        //     $jstools.ajaxJson.get('./test.json'),
        //     $jstools.ajaxJson.get('./test1.json')
        // ]).then((res) => {
        //     console.log(111, res)
        // })
        // window.bb = Promise.all([
        //     $jstools.ajaxJson.get('./test.json'),
        //     $jstools.ajaxJson.get('./test1.json')
        // ]).then((res) => {
        //     console.log(222, res)
        // })

    </script>
</body>
</html>
